#include"log.hh"
      void Mylogger::warn(const char* msg)
    {
        /* cout<<"\" "<<filename<<" "<<line<<" "<<funcname<<" \""; */
        _cate.warn(msg);
    }
      void Mylogger::error(const char* msg)
    {
        /* cout<<"\""<<filename<<" "<<line<<" "<<funcname<<"\""; */
        _cate.error(msg);
    }
      void Mylogger::debug(const char* msg)
    {
        /* cout<<"\""<<filename<<" "<<line<<" "<<funcname<<"\""; */
        _cate.debug(msg);
    }
      void Mylogger::info(const char* msg)
    {
        /* cout<<"\""<<filename<<" "<<line<<" "<<funcname<<"\""; */
        _cate.info(msg);
    }
      Mylogger* Mylogger::getInstance()
    {
        if(_p==nullptr)
        {
            _p=new Mylogger();
        }
        return _p;
    }
      void Mylogger::destory()
    {
        if(_p)
        {
            Category::shutdown();
            delete _p;
        }
        std::cout<<"destory"<<std::endl;
    }
      void Mylogger::changeDegree( Priority::Value  value)
    {
        _cate.setPriority(value);
        _cate.setPriority(Priority::WARN);
        std::cout<<"change degeree"<<std::endl;
    }

Mylogger::Mylogger()
        :_pos(nullptr)
         ,_ptn(nullptr)
    {
        _pos =new OstreamAppender("screen",&std::cout);
        _ptn =new PatternLayout();
        _ptn->setConversionPattern("%d %c [%p] %m %n");
        _pos->setLayout(_ptn);
        _cate.setPriority(Priority::DEBUG);
        _cate.addAppender(_pos);
        std::cout<<"构造函数"<<std::endl;
    }
Mylogger::~Mylogger()
     {
         std::cout<<"析构"<<std::endl;
     }

Mylogger* Mylogger::_p=nullptr;
Category& Mylogger::_cate=Category::getRoot().getInstance("sub");
